package cn.ddiancan.xddcloud.psc.permission.feign;

import cn.ddiancan.xddcloud.common.entity.CommonResult;
import cn.ddiancan.xddcloud.common.entity.PermissionVO;
import cn.ddiancan.xddcloud.common.entity.UserVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@FeignClient(contextId = "PermissionRemoteService", value = PermissionRemoteService.targetService)
public interface PermissionRemoteService {

    String targetService = "xddcloud-psc";

    @PostMapping("/psc/permission/sync")
    CommonResult<Integer> sysncPermission(@RequestBody List<PermissionVO> permissionServices);

    @GetMapping("/psc/permission/current/user")
    CommonResult<UserVO> getCurrentUserPermission();
}
